package com.currency.mall.adapter;

import android.content.Context;
import android.support.annotation.Nullable;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.currency.mall.R;
import com.currency.mall.entity.RechargeStatus;

import java.util.List;

/**
 * Created by Administrator on 2018/12/5.
 */

public class CaseStatusAdapter extends BaseQuickAdapter<RechargeStatus, BaseViewHolder> {

    public CaseStatusAdapter(@Nullable List<RechargeStatus> data, Context context) {
        super(R.layout.item_case_status, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, RechargeStatus rechargeStatus) {
        TextView typeName = helper.getView(R.id.tv_type_name);
        typeName.setText("提现");
        helper.setText(R.id.tv_price,  rechargeStatus.getCashSum());
        TextView tvStatus = helper.getView(R.id.tv_status);
        if ("WAITING".equals(rechargeStatus.getStatus())) {
            tvStatus.setText("等待确认");
            helper.setText(R.id.tv_time, rechargeStatus.getUpdateTime());
        } else if ("SUCCESS".equals(rechargeStatus.getStatus())) {
            tvStatus.setText("提现成功");
            helper.setText(R.id.tv_time, rechargeStatus.getConfirmTime());
        }

    }

}
